#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
script name: forms
Created on 2020/2/15 21:43 by PyCharm
@author: fujianjian
"""
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, DateField, RadioField, TextAreaField
from wtforms.validators import DataRequired


class AddProductionForm(FlaskForm):
    cover_uri = StringField('Cover Uri')
    name = StringField('Name', validators=[DataRequired(message='name cannot empty')])
    pub_time = DateField('Publish Time', validators=[DataRequired(message='Publish Time Need')])
    type = RadioField('Production Type', choices=[('Y', 'Masaic'), ('N', 'No Masaic')], validators=[DataRequired()])
    category = StringField('production category', validators=[DataRequired()])
    intro = TextAreaField('Public intro')
    submit = SubmitField('submit')


class QueryProductionForm(FlaskForm):
    name = StringField('Product Name')
    submit = SubmitField('search')
